<?php



namespace App\Http\Requests\ApiV2;



use Illuminate\Support\Facades\Auth;


class VideoRequest extends BaseRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'title' => 'required|max:255',
        ];
    }

    public function messages()
    {
        return [
            'title.required' => __('请输入视频标题'),
            'title.max' => __('视频标题长度不能超过:size个字符', ['size' => 255]),
        ];
    }

    public function filldata()
    {
        $user = Auth::user();
        return [
            'user_id'=>(int)$user['id'],
            'title' => $this->input('title'),
            'duration' =>$this->input('duration'),
            'aliyun_video_id'=>$this->input('aliyun_video_id'),

        ];
    }
}
